var app = new Vue({
    el: '#collaborate',
    data() {
        return {
            msg: 'collaborate',
            //总条数
            total: '100',
            //每页数据条数
            pageSize: '5',
            pageNo: 1,
            joinUsList: [],
            index: 2,
            bannerImage: '',
            headerList1: []
        }
    },
    created() {
        this.getJoinUsList()
    },
    methods: {
        getJoinUsList() {
            this.getHeaderList();
            axios.post('company/service/joinUs/findByPageDTO?pageNo=' + this.pageNo + '&pageSize=' + this.pageSize)
                .then(res => {
                    this.joinUsList = res.data.data.list;
                    console.log("1111111111111111111111111")
                    console.log(this.joinUsList)
                    console.log(res.data.data.list)
                })
                .catch(err => {
                    console.error(err);
                })
        },
        getHeaderList() {
            var storage = window.sessionStorage;

            var c = storage.getItem("headerList");

            if (!c) {
                axios.get('system/service/viewMenu/findAll')
                    .then(res => {
                        this.headerList1 = res.data.data;
                        this.bannerImage = this.headerList1[this.index].bgImg
                        storage.setItem("headerList", JSON.stringify(this.headerList1));
                    })
                    .catch(err => {
                        console.error(err);
                    })
            } else {
                this.headerList1 = JSON.parse(c);
                this.bannerImage = this.headerList1[this.index].bgImg
            }
        }
    }
})